package com.jxw.launcher;

import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;

/* loaded from: classes.dex */
public class MyAnimation {
    public static void startAnimationIn(ViewGroup viewGroup, int i) {
        for (int i2 = 0; i2 < viewGroup.getChildCount(); i2++) {
            View childAt = viewGroup.getChildAt(i2);
            childAt.setVisibility(0);
            childAt.setClickable(true);
            childAt.setFocusable(true);
        }
        RotateAnimation rotateAnimation = new RotateAnimation(-180.0f, 0.0f, 1, 0.5f, 1, 1.0f);
        rotateAnimation.setFillAfter(true);
        rotateAnimation.setDuration(i);
        viewGroup.startAnimation(rotateAnimation);
    }

    public static void startAnimationIn(ViewGroup viewGroup, int i, int i2) {
        RotateAnimation rotateAnimation = new RotateAnimation((1 - i) * 37, i * (-37), 1, 0.5f, 1, 0.5f);
        rotateAnimation.setFillAfter(true);
        rotateAnimation.setDuration(i2);
        viewGroup.startAnimation(rotateAnimation);
    }

    public static void startAnimationOut(final ViewGroup viewGroup, int i) {
        RotateAnimation rotateAnimation = new RotateAnimation(-111.0f, -111.0f, 1, 0.5f, 1, 0.5f);
        rotateAnimation.setFillAfter(true);
        rotateAnimation.setDuration(i);
        rotateAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.jxw.launcher.MyAnimation.1
            @Override // android.view.animation.Animation.AnimationListener
            public void onAnimationRepeat(Animation animation) {
            }

            @Override // android.view.animation.Animation.AnimationListener
            public void onAnimationStart(Animation animation) {
            }

            @Override // android.view.animation.Animation.AnimationListener
            public void onAnimationEnd(Animation animation) {
                viewGroup.setVisibility(4);
            }
        });
        viewGroup.startAnimation(rotateAnimation);
    }

    public static void startAnimationOut(final ViewGroup viewGroup, int i, int i2) {
        RotateAnimation rotateAnimation = new RotateAnimation(0.0f, -180.0f, 1, 0.5f, 1, 1.0f);
        rotateAnimation.setFillAfter(true);
        rotateAnimation.setDuration(i);
        rotateAnimation.setStartOffset(i2);
        rotateAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.jxw.launcher.MyAnimation.2
            @Override // android.view.animation.Animation.AnimationListener
            public void onAnimationRepeat(Animation animation) {
            }

            @Override // android.view.animation.Animation.AnimationListener
            public void onAnimationStart(Animation animation) {
            }

            @Override // android.view.animation.Animation.AnimationListener
            public void onAnimationEnd(Animation animation) {
                for (int i3 = 0; i3 < viewGroup.getChildCount(); i3++) {
                    View childAt = viewGroup.getChildAt(i3);
                    childAt.setVisibility(8);
                    childAt.setClickable(false);
                    childAt.setFocusable(false);
                }
                viewGroup.setVisibility(8);
            }
        });
        viewGroup.startAnimation(rotateAnimation);
    }
}
